<template>
    <div class="home">
        <ul>
            <router-link to="/chose/kind?type=repay" tag="li">
                <i class="iconfont icon-huankuan"></i>
                <span>我要还款</span>
            </router-link>
            <router-link to="/chose/kind?type=change" tag="li">
                <i class="iconfont icon-biangeng"></i>
                <span>我要变更</span>
            </router-link>
            <router-link to="/chose/kind?type=get" tag="li">
                <i class="iconfont icon-lingquyouhuiquan"></i>
                <span>我要领取</span>
            </router-link>
            <router-link to="/consult" tag="li">
                <i class="iconfont icon-zixun"></i>
                <span>我要咨询</span>
            </router-link>
        </ul>
    </div>
</template>

<script>
import { getStore, setStore, removeStore } from '../config/mUtils'
import api from "../fetch/api";
export default {
  data() {
    return {};
  },
  created() {
    if (this.$route.query.token) {
      setStore("token", this.$route.query.token);
      api.get_user_bind({'token':getStore('token')}).then(res=>{
          if(res.success==='false'){
              this.$router.replace('/authentication')
          }
      })
    } else {
      window.location.replace(
        "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxacb8feed78b248bd&redirect_uri=http%3a%2f%2fyxx.feipupiano.com%2fweixin%2fapp%2fouath2&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"
      )
    }
  }
};
</script>

<style lang="less" scoped>
.home {
  margin: 1.5rem 0;
  ul {
    margin: 0 1rem;
    li {
      text-align: center;
      background-color: #fff;
      border-radius: 2rem;
      padding: 0.2rem;
      margin-bottom: 1.5rem;
      font-size: 0.7rem;
      display: flex;
      justify-content: center;
      align-items: center;
      width: 100%;
      i {
        font-size: 1rem;
      }
      span {
        padding-left: 0.8rem;
      }
      &:nth-child(1) {
        i {
          color: burlywood;
          font-size: 1.3rem;
        }
      }
      &:nth-child(2) {
        i {
          color: #fe4c1c;
          font-size: 1.3rem;
        }
      }
      &:nth-child(3) {
        i {
          color: #36bc99;
          font-size: 1.3rem;
        }
      }
      &:nth-child(4) {
        i {
          color: #47abf9;
          font-size: 1.3rem;
        }
      }
      &:active {
        color: #fff;
        background-color: #e4192d;
        i {
          color: #fff;
        }
      }
    }
  }
}
</style>
